<template>
	<view class="order-goods" @tap="toDetail()">
		<view class="order-goods-img">
			<image :src="goods.original_image" mode=""></image>
		</view>
		<view class="order-goods-info">
			<view class="order-goods-title">{{goods.goods_name}}</view>
			<view class="price-number">
				<view class="price text-danger">
					<view>￥{{goods.price}}</view>
					<view>可积分抵扣{{goods.point}}元</view>
				</view>
				<view class="number text-gray">x {{goods.number}}</view>
			</view>
			<view class="apply-after" v-if="showApply"><view class="bg-theme" @tap.stop="apply(goods)">申请售后</view></view>
		</view>
	</view>
</template>

<script>
	export default {
		props: ['goods', 'showApply'],
		data() {
			return {
				
			};
		},
		methods: {
			apply(goods) {
				var url = '/pages/aftersales/select-type?order_id='+goods.order_id+'&item_id='+goods.id;
				uni.navigateTo({
					url: url
				})
			},
			toDetail(){
				this.$emit('toDetail')
			}
		}
	}
</script>

<style>
	.order-goods{
		display: flex;
		flex-direction: row;
		padding: 20upx;
		align-items: center;
		border-bottom: 1upx solid #eee;
		font-size: 28upx;
		background: #fff;
	}
	
	.order-goods .order-goods-img image{
		width: 150upx;
		height: 150upx;
	}
	
	.order-goods .order-goods-info{
		flex: 1;
		padding-left: 20upx;
	}
	
	.order-goods .order-goods-info .price-number{
		display: flex;
		flex: row;
		justify-content: space-between;
		align-items: flex-end;
	}
	
	.order-goods .order-goods-info .apply-after{
		margin-top: 10upx;
		display: flex;
		justify-content: flex-end;
	}
	
	.order-goods .order-goods-info .apply-after view{
		color: #fff;
		font-size: 24upx;
		height: 50upx;
		padding: 0upx 30upx;
		line-height: 50upx;
		border-radius: 25upx;
	}
	
	
</style>
